import java.io.*;

public class Demo12 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("d:/test.txt")) {
            PrintWriter printWriter = new PrintWriter(outputStream);
            printWriter.printf("hello");
            // 确保数据写入到硬盘上
            printWriter.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
